$(document).ready(function(){
	
});


function sysUserImport() {
	if (!Validator.Validate(document.getElementById("form1"), 1)) {
		return;
	}
	
	var fileField=$("#fileField").val();
	if(fileField==''){
		jalert("抱歉，请选择下载系统模板添再导入！");
		return;
	}
	if (!(/(?:xls|xlsx)$/i.test(fileField))) {
		jalert("请选择上传，支持xls、xlsx格式的文档！");
		return;
	}
	/*if(fileField.indexOf("学生信息模板") ==-1){
		jalert("请导入正确的模板！");
		return;
	}*/
	
	//showLoading('信息导入中......');
	$("#form1").ajaxSubmit({
		url:ctp+"/sysuserController/sysUserImport.shtml",
		type:"POST",
		dataType : 'json',
		async:false, 
		success : function(date) { 
			alert(typeof(date));
			/*closeLoading();	
			if(date.isSame ==""){
				jalert9(date.result);
				parent.searchData();
				setTimeout(function(){
					window.parent.closeDialogWin();
				},3000);
			}else{
				parent.studentImportDeal(date.recId);
				document.querySelector('.list-template').style.opacity = 0;
			}*/
  		}
  	});

}

function down(){
	jconfirm("downs()","是否下载导入模板？");	
}
function downs(){
	
	/*if(BrowserDetect.browser=='Mozilla'&&BrowserDetect.version=='11'){
		window.open(ctp+"/file/student.xls");
	}else{
		location.href=ctp+"/file/student.xls";
	}	*/
	window.location.href=ctp + "/sysuserController/sysUserModelExport.shtml";
}

function back(){
	window.parent.closeDialogWin();
}